import java.util.Scanner;

public class Work4 {
    public static void main(String[] args) {
        System.out.println("输入要购买的长度");
        Scanner scanner=new Scanner(System.in);
        int gen=scanner.nextInt();
        if (gen%3>0){
            System.out.println("需要买"+(gen/3+1)+"根");
        }
        else {
            System.out.println("需要买"+gen/3+"根");
        }
    }
}
